package com.jt.www.enums.extend;

import org.apache.commons.lang3.StringUtils;

/**
 * 排查项目的项目（学校）类型
 */
public enum SchoolTypeEnum {
    KINDERGARTEN("幼儿园", "edu_06"),
    PRIMARY("小学", "edu_07"),
    MIDDLE("普通中学", "edu_08"),
    SV("中职", "edu_09"),
    HV("高职", "edu_10"),
    UNIVERSITY("普通高校（不含高等职业院校）", "edu_11"),
    WORK_READ("工读学校", "edu_12"),
    SPECIAL("特殊学校", "edu_13"),
    TRAINING("教育培训机构", "edu_14"),
    OTHER("其他", "edu_15"),
    ADULT_COLLEGE("成人高校(不含高等职业院校)", "edu_25"),
    WORK_STUDY_SCHOOLS("工读学校", "edu_26"),
    JUNIOR_HIGH_SCHOOL("初中", "edu_27"),
    SENIOR_HIGH_SCHOOL("高中", "edu_28"),
    DANCE_SCHOOL("舞蹈学校", "edu_29"),
    MEDICAL_COLLEGES("医学院校", "edu_30"),
    TECHNICIAN_TRAINING_SCHOOL("技工学校", "edu_31"),
    COLLEGE("大学", "edu_32"),
    COMPLETE_MIDDLE_SCHOOL("完全中学（初高中一体）","edu_33"),
    NINE_YEAR_SYSTEM("九年一贯制","edu_34"),
    FIFTEEN_YEAR_SYSTEM("十五年一贯制","edu_35");

    private String msg;
    private String code;

    SchoolTypeEnum(String msg, String code) {
        this.msg = msg;
        this.code = code;
    }

    public static String getMsgByCode(String code) {
        if(StringUtils.isEmpty(code)){
            return "";
        }
        for(SchoolTypeEnum typeEnum : SchoolTypeEnum.values()){
            if(typeEnum.code.equals(code)){
                return typeEnum.msg;
            }
        }
        return "其他";
    }

    public static String getCodeByMsg(String msg) {
        for(SchoolTypeEnum typeEnum : SchoolTypeEnum.values()){
            if(typeEnum.msg.equals(msg)){
                return typeEnum.code;
            }
        }
        return SchoolTypeEnum.OTHER.code;
    }

    public String getMsg() {
        return msg;
    }

    public String getCode() {
        return code;
    }
}
